package algorithm;

public class Edge {
	private int source;
	private int target;
	
	public Edge(int source, int target) {
		super();
		this.source = source;
		this.target = target;
	}
	public int getSource() {
		return source;
	}
	public void setSource(int source) {
		this.source = source;
	}
	public int getTarget() {
		return target;
	}
	public void setTarget(int target) {
		this.target = target;
	}
	
	@Override
	public boolean equals(Object o) {
		if(this.source==((Edge)o).getSource()&&this.target==((Edge)o).getTarget())
			return true;
		else if(this.source==((Edge)o).getTarget()&&this.target==((Edge)o).getSource())
			return true;
		else return false;

	}
	@Override
	public int hashCode() {
		return this.source+this.target;
	}
	@Override
	public String toString() {
		return source+" "+target;
	}
} 
